﻿using DataModels.Dto;
using DataModels.Entities.Base;
using Microsoft.AspNetCore.Mvc;
using Services.Community;
using Utils;

namespace PropertyManagementWebApi.Controllers.Community
{
    public class HomeLettersController(HomeLettersService homeLettersService) : BaseController
    {
        protected readonly HomeLettersService _homeLettersService = homeLettersService;

        /// <summary>
        /// 获取家书列表
        /// </summary>
        /// <param name="ProjectId"></param>
        /// <param name="StartTime"></param>
        /// <param name="EndTime"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHomeLetters(Guid? ProjectId, DateTime? StartTime, DateTime? EndTime)
        {
            return _homeLettersService.GetHomeLetters(ProjectId, StartTime, EndTime);
        }

        /// <summary>
        /// 获取家书列表，家书和目录一并返回  add by tianjh 20250802
        /// </summary>
        /// <param name="ProjectUUUID"></param>
        /// <param name="StartTime"></param>
        /// <param name="EndTime"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHomeLetterList(Guid? ProjectUUUID, DateTime? StartTime, DateTime? EndTime)
        {
            return _homeLettersService.GetHomeLetterList(ProjectUUUID, StartTime, EndTime);
        }

        /// <summary>
        /// 获取家书目录
        /// </summary>
        /// <param name="UUID"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHomeLettersCatalogue(Guid UUID)
        {
            return _homeLettersService.GetHomeLettersCatalogue(UUID);
        }

        /// <summary>
        /// 获取家书详情
        /// </summary>
        /// <param name="HomeLettersId"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetHomeLettersDetails([GeneralRequired] Guid HomeLettersId)
        {
            return _homeLettersService.GetHomeLettersDetails(HomeLettersId);
        }

    }
}
